<template>
    <div class="componentContainer" :info="getComponentName">
        <component :is="componentName"/>
    </div>
</template>

<script>
import {doThirdServiceValue} from "@/request/lowcode/thirdService";

export default {
    name: "VueComponentComponent",
    props: ['propJson', 'commonParam'],
    data() {
        return {
            componentName: ""
        }
    },
    methods: {
        execComponentNameThen(resValue, execParam) {
            if (resValue) {
                this.componentName = resValue
            } else {
                this.componentName = "CloseCircleOutlined"
            }
        },
        execComponentNameCatch(resValue) {

        }
    },
    computed: {
        async getComponentName() {
            if (this.propJson.editFlag) {
                return;
            }
            await doThirdServiceValue(this.propJson.componentNameParam, this.commonParam, this.execComponentNameThen, this.execComponentNameCatch, {})
        }
    }
}
</script>

<style scoped lang="less">

</style>